package com.chuantou.yuba.api.to;

import com.google.gson.annotations.SerializedName;

import android.os.Parcel;
import android.os.Parcelable;

public class FishingPlaceDetailTO implements Parcelable {

	@SerializedName("detail")
	private FishingPlaceTO place;

	@SerializedName("fav")
	private int fav;

	public FishingPlaceDetailTO(Parcel source) {
		this.place = source.readParcelable(FishingPlaceTO.class.getClassLoader());
		this.fav = source.readInt();
	}

	public boolean isFaved() {
		return fav == 1;
	}

	public void setFaved(boolean faved) {
		fav = faved ? 1 : 0;
	}

	public FishingPlaceDetailTO() {

	}

	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeParcelable(place, flags);
		dest.writeInt(fav);
	}

	public static final Creator<FishingPlaceDetailTO> CREATOR = new Creator<FishingPlaceDetailTO>() {

		@Override
		public FishingPlaceDetailTO[] newArray(int size) {
			return new FishingPlaceDetailTO[size];
		}

		@Override
		public FishingPlaceDetailTO createFromParcel(Parcel source) {
			return new FishingPlaceDetailTO(source);
		}
	};

	public FishingPlaceTO getPlace() {
		return place;
	}

	public void setPlace(FishingPlaceTO place) {
		this.place = place;
	}

	public int getFav() {
		return fav;
	}

	public void setFav(int fav) {
		this.fav = fav;
	}

}
